package com.timebank.volunteer.service;

import com.timebank.common.core.constant.SecurityConstants;
import com.timebank.common.core.constant.ServiceNameConstants;
import com.timebank.common.core.result.Result;
import com.timebank.volunteer.factory.RemoteVolunteerFallBackFactory;
import com.timebank.volunteer.pojo.entity.Volunteer;
import com.timebank.volunteer.pojo.entity.VolunteerAttendList;
import com.timebank.volunteer.pojo.entity.VolunteerList;
import com.timebank.volunteer.pojo.vo.VolunteerAttendListVO;
import io.swagger.annotations.Api;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 志愿服务 服务
 * @author shiliuyinzhen
 */
@FeignClient(contextId = "remoteVolunteerService", value = ServiceNameConstants.VOLUNTEER_SERVICE, fallbackFactory = RemoteVolunteerFallBackFactory.class)
@Api(tags = "志愿服务服务")
public interface RemoteVolunteerService {

    /**
     * 根据志愿服务Id查询志愿服务信息
     * @param volunteerId
     * @param source
     * @return
     */
    @GetMapping("/service/{volunteerId}")
    Result<Volunteer> getVolunteerById(@PathVariable("volunteerId") Long volunteerId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 根据志愿服务Id查询志愿服务参与列表
     * @param volunteerId
     * @param source
     * @return
     */
    @GetMapping("/volunteerList/{volunteerId}")
    Result<List<VolunteerList>> getVolunteerListByVolunteerId(@PathVariable("volunteerId") Long volunteerId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 根据志愿服务Id查询志愿服务出席名单
     * @param volunteerId
     * @param source
     * @return
     */
    @GetMapping("/attendList/{volunteerId}")
    Result<List<VolunteerAttendListVO>> getVolunteerAttendListByVolunteerId(@PathVariable("volunteerId") Long volunteerId, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);
}
